[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Function            getstr - input a string from the keyboard

  Syntax              char *getstr(int size, char *pattern);

  Prototype in        keyboard.h

  Remarks             getstr inputs a string from the keyboard, of
                      maximum length size, given a format pattern. See
                      getget() for a list of format modifiers.
                      The only other valid keys are backspace and ENTER.

                      Video output is via Borland's console i/o.

  Return value        returns a pointer to the storage location
                      containing the formatted string, or NULL if space
                      could not be allocated.

  See also            getget()

  Example             #include <keyboard.h>
                      #include <stdio.h>

                      main()
                      {
                           char *f, *l, *s, *c;

                           printf("First name: ");
                           f = getget(10,"A");
                           printf("Last name: ");
                           l = getget(20,"a");
                           printf("SS#: ");
                           s = getget(8,"9");
                           printf("Comments: ");
                           c = getget(60,"");
                      }

  Program output      First name: HOWARD
                      Last name: kapustein
                      SS#: 123456789
                      Comments: The empty quotes defaults to X.


See Also: getget()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson